import java.util.Vector;


public class singleCode {
	public Vector codes=new Vector();
	public String name;
	public singleCode(String n)
	{
		name=n;
	}
	public void add(String s1,String s2,String s3,String s4)
	{
		codes.add(s1);
		codes.add(s2);
		codes.add(s3);
		codes.add(s4);
	}
	public String get(int num)
	{
		if(num<0||num*4+4>codes.size())return "";
		String str="";
		str+=codes.get(num*4).toString()+"\t"+codes.get(num*4+1).toString()+"\t"+
			codes.get(num*4+2).toString()+"\t"+codes.get(num*4+3).toString();
		return str;
	}
	public String get()
	{
		String str="";
		for(int i=0;i<codes.size();i++)
		{
			str+=codes.get(i).toString()+"\t";
			if(i%4==3)
				str+="\n";
		}
		return str;
	}
	public boolean delete(int num)
	{
		if(num<0||num*4+4>codes.size())return false;
		for(int i=0;i<4;i++)
			codes.remove(num*4);
		return true;
	}
	public void clear()
	{
		codes.clear();
	}
	public static void main(String[] args)
	{
		String s="sdfds";
		singleCode F_main=new singleCode(s);
		F_main.add("minus", "c", "", "t1");
		F_main.add("*", "b", "t1", "t2");
		F_main.add("minus", "c", "", "t3");
		F_main.add("*", "b", "t3", "t4");
		F_main.add("+", "t2", "t4", "t5");
		F_main.add("=", "t5", "", "a");
		System.out.print("The origin codes\n"+F_main.get());
		F_main.delete(2);
		System.out.print("The deleted codes\n"+F_main.get());
		System.out.print("The first line:\n"+F_main.get(0));
		F_main.clear();
		System.out.print("\nThe cleared codes\n"+F_main.get());
	}
}